package sample3.evaluators;

import sample3.visitor.Visitor;

public class NegationEvaluator implements Evaluator {

	private final Evaluator op1;

	public NegationEvaluator(Evaluator op1) {
		super();
		this.op1 = op1;
	}

	public int evaluate() {
		return -op1.evaluate();
	}

	public String toTreeString(String indent) {
		return "\n" + indent + "Divide" + op1.toTreeString(indent + " ");
	}

	public void accept(Visitor visitor) {
		visitor.visit(this);
	}
}
